Password and Group Handling

#include unixlib.h>

int endpwent(); Close password file.

int setpwent(); Open password file for further operations.

void setpwfile(char &sstarf#star;fname); Use the fname instead of /etc/passwd as password file.


The following routines already use the above functions.

#include pwd.h>

struct passwd &sstarf#star;getpwent(); Return an entry from the password file.

struct passwd &sstarf#star;getpwuid(int uid); Return the entry from the password file for uid.

struct passwd &sstarf#star;getpwnam(char &sstarf#star;user); Return the entry from the password file for user.


#include grp.h>

struct group &sstarf#star;getgrgid(int gid); Return the entry from the group file for gid. (Mostly fake, returning root or user as groupnames)

struct group &sstarf#star;getgrnam(char &sstarf#star;gname); Return the entry from the group file for gname. (Mostly fake, returning root or user as groupnames)